The Week View component > FWeekView.setChangeHandler() |
FWeekView.setChangeHandler()
Availability
Flash Player 6.
Usage
myWeekView_wkv.setChangeHandler (fnc [, scope])
Parameters
fnc A String specifying the function name that
will be called when the selected date within the component changes.
scope An Object whose scope the change handler function will run within. The
parameter is optional.
Returns
Nothing.
Description
This method specifies the function that will be called when the selected date within the component changes. If the second parameter is passed in, the change handler function will be run within its scope. If it is not specified, the change handler will be run within the _parent scope.
Example
The week_getSelectedDate.fla example file contains an example of using this method.
The following code set the selected date to the current date, which then triggers the change handler to be called.
function onWeekChange(view)
{
trace( "Selected Date: " + view.getSelectedDate() ); //will trace today's date
}
var dateObj = new Date( ); //today's date
myWeekView_wkv.setChangeHandler( "onWeekChange" );
myWeekView_wkv.setSelectedDate( dateObj );